<!-- 商品 -->
<template>
	<view class="container">
		<view class="list">
			<!-- 订单 -->
			<view class="list-header">
				<text class="list-title">订单商品</text>
				<view class="list-btn-group">
					<!-- <button class="btn iconfont btn-transition-scale9" @click="handleNavToChat()">&#xe615;</button> -->
					<!-- <view class="split"></view> -->
					<button class="btn iconfont btn-transition-scale9" @click="handlePhoneCall()">&#xe616;</button>
				</view>
			</view>
			<!-- 商品列表 -->
			<view class="list-item border-bottom-1px" v-for="value in 2" :key="value">
				<image class="pic" :src="'/pagesB-order/static/images/will-delete/02.png'" mode="aspectFit"></image>
				<view class="content">
					<view class="header">
						<text class="name">舒绝瓶装红火蚁药红蚂蚁杀蚁</text>
						<text class="total">￥17.8</text>
					</view>
					<view class="body">
						<text class="label">规格:500ml药剂</text>
						<text class="label">x2</text>
					</view>
				</view>
			</view>
			<!-- 统计 -->
			<view class="statis">
				<view class="statis-item">
					<text class="label">共2件商品，小计：</text>
					<text class="value">￥56.34</text>
				</view>
				<view class="statis-item">
					<text class="label">优惠券抵扣：</text>
					<text class="value">-￥8.00</text>
				</view>
				<view class="statis-item">
					<text class="label">实付金额：</text>
					<text class="value">￥48.34</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	const handleNavToChat = () => {
		uni.navigateTo({
			url: '/pagesB-message/chat/index'
		})
	}
	
	const handlePhoneCall = () => {
		uni.makePhoneCall({
			phoneNumber: '114'
		})
	}
</script>

<style lang="scss" scoped>
	.container {
		position: relative;
		z-index: 2;
		padding: 0 25rpx;
		margin-top: -44rpx;
	}

	.list {
		border-radius: 20rpx;
		background-color: white;
		padding: 26rpx 26rpx 0;

		&-header {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.list-title {
				display: flex;
				align-items: center;
				font-weight: 500;
				font-size: 28rpx;
				color: #222222;

				.iconfont {
					fontn-size: 34rpx;
					color: #999999;
					margin-right: 10rpx;
				}
			}

			.list-btn-group {
				display: flex;
				align-items: center;

				.split {
					width: 1rpx;
					height: 33rpx;
					background-color: #D6D6D6;
					margin: 0 26rpx;
				}

				.btn {
					font-size: 34rpx;
					color: #222222;
					background-color: transparent;
				}
			}
		}


		&-item {
			display: flex;
			align-items: center;
			height: 180rpx;
			// border-bottom: 1rpx solid #E5E5E5;
			
			&::after {
				border-color: #E5E5E5;
			}

			.pic {
				flex-shrink: 0;
				width: 90rpx;
				height: 90rpx;
			}

			.content {
				flex-grow: 1;
				padding-left: 20rpx;

				.header {
					display: flex;
					line-height: 1.5;

					.name {
						flex-grow: 1;
						width: 0;
						font-weight: bold;
						font-size: 28rpx;
						color: #222222;
						padding-right: 10rpx;
						text-overflow: ellipsis;
						overflow: hidden;
						white-space: nowrap;
					}

					.total {
						flex-shrink: 0;
						font-weight: bold;
						font-size: 26rpx;
						color: #222222;
					}
				}

				.body {
					display: flex;
					justify-content: space-between;
					line-height: 2;

					.label {
						font-weight: 500;
						font-size: 24rpx;
						color: #999999;
					}
				}
			}
		}

		.statis {
			padding: 30rpx 0;

			&-item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 28rpx;
				color: #222222;
				line-height: 60rpx;
			}
		}
	}
</style>